package com.yf.service.im;

import com.yf.entity.MsgEntity;
import com.yf.entity.UserEntity;
import com.yf.im.protocol.MsgPb;
import com.yf.service.BaseService;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/api/msg")
public interface MsgService extends BaseService<MsgEntity> {

    /**
     * 拉取某个用户的所有离线消息
     * @param
     * @return
     */
     List<MsgEntity> offlineMsgList(Long userId);

    /**
     * 存储消息
     * @param msgEntity
     */
    MsgEntity saveMsg(MsgPb.Message msgEntity);


    MsgPb.Message msgToProto(Object msgEntity);

    MsgEntity protoToMsg(Object msgEntity);

    /**
     * 找出某个人的消息聊天记录
     *
     * @param
     * @return
     */
    List<MsgEntity> getMsgRecord(Long UserId);

    /**
     * 获取自己跟某人的聊天 验证关系
     *
     */
    List<MsgEntity> getFriendMsg(UserEntity userEntity, Long sessionId,Integer chatType,Long msgTime,Integer limit);
}
